package com.biz.primus.ms.oms.service.allocation.validator;

import com.biz.primus.ms.oms.dao.po.OmsOrder;

/**
 *
 * 订单金额验证器,主要用于确认订单金额是否正确
 *
 * @author yanweijin
 * @date 2017/11/6
 */
public class AmountValidator implements OrderValidator{




	@Override
	public VerificationResult validate(OmsOrder order) {
		if(order.getPaidAmount()==order.getOrderAmount()+order.getFreightAmount()){
			return new VerificationResult(false,null);
		}
		return new VerificationResult(true,"订单金额有误,无法自动分单!");
	}

	@Override
	public String getValidatorName() {
		return "amount";
	}
}
